package com.noocodecommit.wicket.jquery.tutorial;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;

import com.noocodecommit.wicket.stuff.jquery.JQCore;
import com.noocodecommit.wicket.stuff.jquery.plugin.effects.JQAnimation;
import com.noocodecommit.wicket.stuff.jquery.plugin.effects.blind.JQBlind;
import com.noocodecommit.wicket.stuff.jquery.plugin.effects.blind.JQBlindOptions;

public class TutorialPage1 extends WebPage
{
	public TutorialPage1()
	{
		super();
		JQCore.init(this);
		
		// -- cible de l'animation
		final Label block = new Label("block", "block");
		block.setOutputMarkupId(true);
		add(block);
		 
		// -- Effect toggle Vertical
		add(new AjaxLink("effect1")
		{
		    public void onClick(AjaxRequestTarget target)
		    {
		        target.appendJavascript(JQAnimation.toggle(block, new JQBlind(JQBlindOptions.DIRECTION_VERTICAL)));
		    }
		});
	}
}
